package jman.competition12;

public class User {
	private String userName;
	private String password;
	private Capitalaccount c=new Capitalaccount();
	public Capitalaccount getC() {
		return c;
	}
	public void setC(Capitalaccount c) {
		this.c = c;
	}
	public User(){
	}
	public User(String userName,String password){
		this.userName=userName;
		this.password=password;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	//存钱
	public void add(double money){
		this.c.setMoney(c.getMoney()+money);
	}
	//转账
	public void transfer(double money,User user){
		c.setMoney(c.getMoney()-money);
		user.add(money);
	}
	//注销
	public void logout(){
		c=null;
	}
}
